<?php

class Log_model extends CI_Model {
    public function __construct() {
        $this->load->database();
    }
    
    public function set($datos) {
        $this->db->insert('log', $datos);
    }
    
    public function get($tabla, $iddelatabla, $idtabla) {
        $query = $this->db->query("SELECT *
                                    FROM
                                        log l,
                                        usuarios u
                                    WHERE
                                        l.tabla = '$tabla' AND
                                        l.iddelatabla = '$iddelatabla' AND
                                        l.idtabla = '$idtabla'
                                    ORDER BY
                                        l.fecha DESC");
        return $query->result_array();
    }
}
?>
